$(window).scroll
(
    function()
    {
        var o = $('#newPost');
	    if(o!=null )
        {
            var hght= document.body.scrollHeight;
	    var clt = document.documentElement.clientHeight;
            var ctop = document.documentElement.scrollTop;
	    //alert(parseInt(hght) - clt + "\n" + ctop);
            if(ctop >= (parseInt(hght) - clt - 10))
            {
                page = parseInt(page) - 20;
                ReadMore(page);
            }
        }
    }
);

function ReadMore(page)
{
	$("#news-bottom-list").html('<img src="/images/loading.gif">');
    $.get('nextPage/' + page, {},
    		function(data)
    		{
    			$("#news-bottom-list").html('');
    			$("#newPost").append(data);
    		});
}
